home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue31 / webcomm / TRNPF.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1998-01-12  |  1.9 KB  |  82 lines

  1. unit TrnPf;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, webtrans,
  7.   StdCtrls, Buttons, ExtCtrls;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     Panel1: TPanel;
  12.     Panel2: TPanel;
  13.     Edit1: TEdit;
  14.     Label1: TLabel;
  15.     Edit2: TEdit;
  16.     Edit3: TEdit;
  17.     Edit4: TEdit;
  18.     Edit5: TEdit;
  19.     Label2: TLabel;
  20.     Label3: TLabel;
  21.     Label4: TLabel;
  22.     Label5: TLabel;
  23.     Status: TPanel;
  24.     SimpleFileTransactionProcessor1: TSimpleFileTransactionProcessor;
  25.     Timer1: TTimer;
  26.     procedure FormCreate(Sender: TObject);
  27.     procedure Edit1Change(Sender: TObject);
  28.     procedure Timer1Timer(Sender: TObject);
  29.   private
  30.     { Private declarations }
  31.   public
  32.     { Public declarations }
  33.   end;
  34.  
  35. var
  36.   Form1: TForm1;
  37.  
  38. implementation
  39.  
  40. {$R *.DFM}
  41.  
  42. procedure TForm1.FormCreate(Sender: TObject);
  43. begin
  44.    Edit1.text := ExtractFilePath(paramstr(0));
  45. end;
  46.  
  47. procedure TForm1.Edit1Change(Sender: TObject);
  48. begin
  49.   SimpleFileTransactionProcessor1.QueueDirectory := Edit1.text;
  50. end;
  51.  
  52. procedure TForm1.Timer1Timer(Sender: TObject);
  53. begin
  54.    Timer1.enabled := False;
  55.    try
  56.      if SimpleFileTransactionProcessor1.GetNextTransaction then
  57.       with SimpleFileTransactionProcessor1,SimpleFileTransactionProcessor1.TransactionData do
  58.       begin
  59.         Status.caption := StatusMessage;
  60.         Edit5.Text := TransactionID;
  61.         Edit2.Text:=  CardNumber;
  62.         Edit3.Text := ExpiryMonth+'/'+ExpiryYear;
  63.         Edit4.Text := TransactionAmount;
  64.         Application.Restore;
  65.         beep;
  66.         if MessageDlg('Accept this transaction?',mtConfirmation,[mbYes, mbNo],0)=id_Yes then
  67.         begin
  68.           TransactionStatus := tsAccept
  69.         end
  70.         else
  71.           TransactionStatus := tsReject;
  72.         Status.caption := StatusMessage+' at '+DateTimeToStr(Now);
  73.         SaveTransaction;
  74.       end;
  75.    finally
  76.      Timer1.enabled := True;
  77.      Application.Minimize;
  78.    end;
  79. end;
  80.  
  81. end.
  82.